package com.juli.school.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import com.juli.school.dao.entity.Richang;
import com.juli.school.dao.mapper.RichangMapper;
import com.juli.school.utils.core.model.CommonResp;

@Service
public class RichangService {
	
	private static final Logger logger = LoggerFactory.getLogger(Richang.class);
	
	@Resource
	RichangMapper richangMapper;
	
	public CommonResp<List<Richang>> query(int i) {
		CommonResp<List<Richang>> commonResp = new CommonResp<List<Richang>>();
		try {
			// 根据传过来的不同数分别查询不同类型
			Richang richang = new Richang();
			richang.setKind(i);
			List<Richang> list = richangMapper.list(richang);
			commonResp.setData(list);
			commonResp.success();
		} catch (Exception e) {
			logger.error("查询日常列表发生异常",e);
			commonResp.exception();
		}
		return commonResp;
	}
}
